-- get_gold
-- created by panyl
-- 花费探索点时额外获得金币

return {
    apply = function(prop, baseValue)
        return prop[3];
    end,

    -- 消耗探索点触发
    trigger = function(who, prop, arg)
        -- 概率
        if DungeonM.getRandSeed("get_gold") % 1000 >= tonumber(prop[2]) then
            -- 没发生
            return false;
        end

        local count = math.modf(arg * prop[3] / 1000);

        local bonus = { 2, "money", count, };
        BonusM.doBonus(bonus, "prop_get_gold");

        -- 从左下角飞去
        EventMgr.fire(event.OPEN_GRID_MONEY, {["bonus"] = bonus,
                ["pos"] = 26, ["newBonus"] = nil, });

        return true;
    end,

    record = function(target, prop, path)
        return false;
    end
};
